﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Logger
{
    public static class DNPCLogManager
    {
        public static IDNPCLogger GetDNPCLogger()
        {
            StackTrace stack = new StackTrace();
            var stackFrame = stack.GetFrame(1);
            if (stackFrame != null)
            {
                var method = stackFrame.GetMethod();
                if (method != null)
                {
                    return new DNPCLogger(method.DeclaringType);
                }
            }
            return new DNPCLogger(string.Empty);
        }
        public static IDNPCLogger GetDNPCLogger(string dname)
        {
            return new DNPCLogger(dname);
        }
    }

}
